package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.util.ApplicationInstance;
import com.hnkywl.sts.entity.htgl.Xsht;
import com.hnkywl.sts.service.htgl.XshtService;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-4-29
 * Time: 下午3:16
 * To change this template use File | Settings | File Templates.
 */
public class EndXshtState implements EventListener {

    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        XshtService xshtService = ApplicationInstance.createXshtService();
        Xsht xsht = xshtService.findXshtDetailByProcessInstance(execution.getProcessInstance().getId());
        xsht.setZt("ysp");
        xshtService.editXsht(xsht,xsht.getHtbm());
    }
}
